import { ref } from "vue";
import { listByBusinessIdApi } from "@/api/waybillManagement/businessWaybill";

export default function UploadFileHook() {
  //上传文件对应的接口
  const getUpdateOptions: Map<string, any> = new Map([["Problem", listByBusinessIdApi]]);

  //选择上传文件的类型
  const upLoadType = ref<string>("");

  //上传文件回调
  const upLoadRequestFn = (from: File) => {
    const MapRequest = getUpdateOptions.get(upLoadType.value);
    return MapRequest(from);
  };

  return {
    upLoadType,
    upLoadRequestFn
  };
}
